
$.fn.FrmJSON = function()  {  
    var o = {};  
    var frmData = this.serializeArray(); 

    $.each(frmData, function() {
      if (o[this.name]) {
        if (!o[this.name].push) {  
          o[this.name] = [o[this.name]];
        }
        o[this.name].push(this.value || '');  
      }else{  
        o[this.name] = this.value || '';  
      } 
    });  
    return JSON.stringify(o);  
  };